// 点位管理类接口
import { http } from "@/utils/http";

type ResultTable = {
  total?: number;
  data?: Array<any>;
};

// 点位分页查询
export const pagePointList = (data?: Record<string, any>) => {
  return http.request<ResultTable>("post", "/account/api/v1/point/pagePointList", { data });
};

// 点位新增
export const createPoint = (data?: Record<string, any>) => {
  return http.request("post", "/account/api/v1/point/createPoint", { data });
};

// 点位编辑
export const editData = (data?: Record<string, any>) => {
  return http.request("post", "/account/api/v1/point/updatePoint", { data });
};
// 新增---设备编码下拉框
export const queryListByEqpIds = (data?: Record<string, any>) => {
  return http.request("post", "/digitaltwins/api/v1/publish/equipment/queryListByEqpIds", { data });
};

// 点位导入
export const getPointImport = (data?: object) => {
  return http.request(
    "post",
    "/account/api/v1/point/importPoint",
    {
      data
    },
    {
      headers: {
        "Content-type": "multipart/form-data"
      }
    }
  );
};
